home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 July / Chip_1998-07_cd.bin / zkuste / mazda / mazIn311.dxr / Internal_9_Sound Play Castmember.ls < prev    next >
Encoding:
Text File  |  1998-05-06  |  1.5 KB  |  56 lines

  1. property whichevent, WhichSound, WhichChannel, StartImmediately, tester
  2.  
  3. on initPlayMember me
  4.   init(me)
  5. end
  6.  
  7. on mouseUp me
  8.   if whichevent = #mouseUp then
  9.     init(me)
  10.   end if
  11. end
  12.  
  13. on mouseDown me
  14.   if whichevent = #mouseDown then
  15.     init(me)
  16.   end if
  17. end
  18.  
  19. on prepareFrame me
  20.   if whichevent = #prepareFrame then
  21.     init(me)
  22.   end if
  23. end
  24.  
  25. on enterFrame me
  26.   if whichevent = #enterFrame then
  27.     init(me)
  28.   end if
  29. end
  30.  
  31. on exitFrame me
  32.   if whichevent = #exitFrame then
  33.     init(me)
  34.   end if
  35. end
  36.  
  37. on init me
  38.   if soundBusy(the WhichChannel of me) then
  39.     puppetSound(the WhichChannel of me, 0)
  40.     updateStage()
  41.   end if
  42.   puppetSound(the WhichChannel of me, the WhichSound of me)
  43.   if the StartImmediately of me then
  44.     updateStage()
  45.   end if
  46. end
  47.  
  48. on getPropertyDescriptionList
  49.   set p_list to [#WhichSound: [#comment: "Sound:", #format: #sound, #default: EMPTY], #WhichChannel: [#comment: "Channel:", #format: #integer, #default: 1], #whichevent: [#comment: "Initializing Event:", #format: #symbol, #range: [#mouseUp, #mouseDown, #prepareFrame, #enterFrame, #exitFrame, #initPlayMember], #default: #mouseUp]]
  50.   return p_list
  51. end
  52.  
  53. on getBehaviorDescription
  54.   return "Plays the designated sound cast member when the specified event occurs, or when the message ." & RETURN & "PARAMETERS:" & RETURN & "ΓÇó Sound - Choose the sound cast member to be played." & RETURN & "ΓÇó Channel - Enter the sound channel number to be used for playback." & RETURN & "ΓÇó Initializing Event - Specify the event that triggers the behavior."
  55. end
  56.